package com.lsp.microuser.point.controller;

import com.lsp.microcommon.annotation.NoLogin;
import com.lsp.microcommon.utils.XxlJobUtil;
import com.lsp.microcommon.xxl.XxlJobInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/job")
public class XxlJobInfoController {

    @Autowired
    private XxlJobUtil xxlJobUtil;

    @NoLogin
    @PostMapping("/add")
    public String add(@RequestBody XxlJobInfo jobInfo) {
        return xxlJobUtil.addAndStart(jobInfo);
    }

}
